const { ipcRenderer } = require('electron')

window.addEventListener('DOMContentLoaded', () => {
  const replaceText = (selector, text) => {
    const element = document.getElementById(selector)
    if (element) element.innerText = text
  }

  ipcRenderer.invoke('version', '').then((result) => {
    replaceText('electronjs-wechat-version', result.electronjs_wechat_version)
    replaceText('electronjs-version', result.electronjs_version)
  })
})

